'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app

  router.get('/api/index', controller.home.index)
  router.post('/api/register', controller.user.register)
  router.post('/api/login', controller.user.login)

  router.post('/api/knowledge/add', controller.knowledge.add)
  router.get('/api/knowledge/list', controller.knowledge.list)
  router.post('/api/knowledge/delete', controller.knowledge.delete)

  router.post('/api/doc/add', controller.doc.add)
  router.get('/api/doc/list', controller.doc.list)
  router.delete('/api/doc/delete', controller.doc.deleteRow)
  router.get('/api/doc/detail', controller.doc.detail)
};
